package cn.yanhu.kuwanapp.my.adapter

import android.graphics.Color
import cn.woochen.comlib.adapter.CommonRecyclerAdapter
import cn.yanhu.kuwanapp.R
import cn.yanhu.kuwanapp.bean.response.RespMsgBean
import cn.yanhu.kuwanapp.databinding.ItemMessageBinding

class MessageAdapter constructor(datas: List<RespMsgBean>) :
    CommonRecyclerAdapter<RespMsgBean>(datas, R.layout.item_message) {

    override fun convert(holder: ViewHolder, item: RespMsgBean) {
        holder.getDataBinding<ItemMessageBinding?>()?.let {
            it.msgInfo = item
            if (item.haveRead == "1"){//已读
                it.tvTitle.setTextColor(Color.parseColor("#1B0A4D"))
            }else{
                it.tvTitle.setTextColor(Color.parseColor("#4C1FD1"))
            }
        }

    }
}